
<?php $this->load->view('includes/header');  
	$projects = $this->session->userdata('projects');
?>

<script>
$(document).ready(function(){
	loadUserProjects();
});
function selectTab(index){
	 $("#tabs").tabs('load', index);
}
$(function() {
	
	$('#tabs').tabs({
	   load: function(event, ui) {
	        $('a', ui.panel).click(function() {
	            $(ui.panel).load(this.href);
	            return false;
	        });
	   	},
		select: function(event, ui){
			if (document.getElementById('form_task_detail') != null){
				document.getElementById('form_task_detail').style.display = 'none';
			}
				
	  	}	
	});;

	$('#tabs').tabs( 'selected' , -1 );
	$(".ui-tabs-selected").removeClass("ui-state-active").removeClass("ui-tabs-selected").addClass("ui-state-default");	

		
	
	$('#logout').click(function () {
		window.location.href = CI.baseUrl + "index.php/authentication_controller/logout/";
	});
	
	
});
</script>
<script language="javascript">
function setCurrentPage(page){
		$('#tabs').tabs({ selected: page });
}
</script>



<div id="tabs">
	<ul>
		<li><IMG SRC= '<?php echo base_Url()?>img/logo2.png' WIDTH=240 HEIGHT=30 BORDER=0 ALT="" ALIGN="RIGHT"></li> 
		
	    <li><a href="<?php echo base_Url()?>index.php/sprint/current_sprint/" name="current_sprint" title=" " id= " " class="nav-link">Current Sprint</a></li>
		<li><a href="<?php echo base_Url()?>index.php/tasks_controller/" name="tasks" title="manage task" id= "tasks" class="nav-link">Tasks</a></li>
		<li><a href="#tabs-4" name=" " title=" " id= " " class="nav-link">Metrics</a></li>
		<li><a href="<?php echo base_Url()?>index.php/user/listUsers" name="users" title="manage users" id= "users" class="nav-link">Users</a></li>
		<li><a href="<?php echo base_Url()?>index.php/sprint" name="sprints" title="manage sprints" id= "sprints" class="nav-link">Sprints</a></li>
		<li><a href="<?php echo base_Url()?>index.php/project_controller/" name="projects" title="manage projects" id= "projects" class="nav-link">Projects</a></li>
		
		 
		
		
		
	    
		<li><a href="<?php echo base_Url()?>index.php/authentication_controller/logout/" name="logout" title="logout from system" id= "logout" class="nav-link"><?php echo $this->session->userdata('username') .' Logout'?></a></li>
	<div id="user_projects_container"></div>
	</ul>
	
	</div>
	<div id="tabs-1"></div>
	<div id="tasks"></div>
	<div id="tabs-4"></div>
	<div id="users"></div>
	<div id="sprints"></div>
	<div id="projects"></div>
	<div id="logout"></div>


<?php  if(isset($page)){
	echo "<SCRIPT LANGUAGE='javascript'>setCurrentPage($page);</SCRIPT>";
		};?>



